package com.sojson.serversocket.config.handler.business;

import org.springframework.stereotype.Component;

import com.sojson.serversocket.util.ServerSocketPoolUtil;
import com.sojson.serversocket.util.enums.EElectricType;

import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.util.AttributeKey;

/**
 * ServerSocket业务包处理器(控阀)
 *
 * @author liu
 * @date 2024-05-30
 */
@Component
public class ServerSocketHandlerControl {

    public void run(ChannelHandlerContext ctx, Byte[] barr, String addrRever, String data) {
        // 总用电量
        String totalWattage = data.substring(8, 16);

        Channel channel = ctx.channel();
        Object object = channel.attr(AttributeKey.valueOf(ServerSocketPoolUtil.TYPE_KEY)).get();
        if (object == EElectricType.FOUR) {
        } else {
        }
    }

}